/*
用户请求订单
*/

angular.module("driver").controller("requestinfoCtrl", ['$scope', '$meteor', '$rootScope', '$state', '$ionicPopup', '$ionicLoading', '$stateParams',
  function($scope, $meteor, $rootScope, $state, $ionicPopup, $ionicLoading,
    $stateParams) {
    $scope.request = $meteor.object(UserRequests, $stateParams.reqId);

    $scope.call = function(number) {
      //console.log(number);
      navigator.callphone.call(function() {}, function(error) {
        showErrorDialog(errors.call);
        log(error);
      }, number);
    };

    $scope.getRequest = function(request) {
      //console.log(request);
      $meteor.call('getRequest', request._id); //接单
      $meteor.call('changeState', 'working'); //接单后改变个人状态为‘工作中’
      $state.go('main.amap');
    };

    $scope.ceshi = function(){
      console.log('sadfsdfsadf');
    }
  }]);
